﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TV_App
{
    class TV
    {
        private List<Channel> channelList;

        public int CurrentChannel { get; set; }


        public void GenerateChannelList()
        {
            channelList = new List<Channel>();

            Channel addedChannel = new Channel(1, "1+1");
            channelList.Add(addedChannel);
            Channel addedChannel2 = new Channel(2, "2+2");
            channelList.Add(addedChannel2);
            Channel addedChannel3 = new Channel(3, "Ukraine");
            channelList.Add(addedChannel3);
            Channel addedChannel4 = new Channel(4, "Fox kids");
            channelList.Add(addedChannel4);
            Channel addedChannel5 = new Channel(5, "Hunting and fishing");
            channelList.Add(addedChannel5);

            CurrentChannel = 0;
        }

        public void SwitchChannelUp()
        {
            if (CurrentChannel == channelList.Count - 1)
                CurrentChannel = 0;
            else
            CurrentChannel += 1;
            Console.WriteLine("CHannel switch up");
        }

        public void SwitchChannelDown()
        {
            if (CurrentChannel == 0)
                CurrentChannel = channelList.Count - 1;
            else
            {
                CurrentChannel -= 1;
            }
            Console.WriteLine("Channel switch down");
        }

        public void ShowCurrentChannel()
        {
            Console.WriteLine("Current channel is {0}: {1}", channelList[CurrentChannel].ChannelNumber, channelList[CurrentChannel].ChannelName);
            Console.ReadKey();
        }
    }
}
